package com.bdqn.tsyyds.entity;


import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.*;

@Entity
@Table(name = "book_info")
public class BookInfo {
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }


    public String getPublish() {
        return publish;
    }

    public void setPublish(String publish) {
        this.publish = publish;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(String publishTime) {
        this.publishTime = publishTime;
    }

    public Boorrow getBoorrow() {
        return boorrow;
    }

    public void setBoorrow(Boorrow boorrow) {
        this.boorrow = boorrow;
    }

    public BookCategory getBookCategory() {
        return bookCategory;
    }

    public void setBookCategory(BookCategory bookCategory) {
        this.bookCategory = bookCategory;
    }

    //book_info表...
    @Id
    @Column(name = "id")
    int id;//book_info表的图书ID


    @Column(name = "book_name")
    String bookName;//book_info表的图书名称


    @Column(name = "publish")
    String publish;//book_info表的图书出版社

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    @Column(name = "author")
    String author;//book_info表的图书的作者


    @Column(name = "publish_time")
    String publishTime;//book_info表的图书时间


    /**
     * 关联orborrow表的
     */
    /*@Column(name = "orborrow")
    int orBorrow;//book_info借书人的时间I*/
    @ManyToOne(targetEntity = Boorrow.class)
    @JoinColumn(name = "orborrow")
    @JsonIgnore
    private Boorrow boorrow;


    /*@Column(name = "book_category_id")
    int bookCategoryId;//book_info书籍的种类*/
    /**
     * 关联BooKCategory的Id获取BooKCategory
     */
    @ManyToOne(targetEntity = BookCategory.class)
    @JoinColumn(name = "book_category_id")
    @JsonIgnore
    private BookCategory bookCategory;//book_info书籍的种类
}
